<template>
	<view class="detail">
		<view class="status">
			<text class="ywc">{{form.orderStatus}}</text>
		</view>
		<view class="kh">

			<text class="xx">客户信息</text>
			<view class="khxx">
				<text>{{form.userAddress.name}}</text> <text>{{form.userAddress.tel}}</text>
				<image @click="totel(form.userAddress.tel)" src="/static/电话.png" mode=""></image>
			</view>
			<view class="address">
				<image src="/static/定位.png" mode=""></image>
				<text>{{form.userAddress.region.label}}{{form.userAddress.detailed}}</text>
			</view>

		</view>
		<view class="ff">
			<text class="ffxx">服务信息</text>
			<view class="xx">
				<image :src="form.img[0]" mode=""></image>
				<view class="tt">
					<text>{{form.serviceName[0]}}</text>
					<text style="color: #737384;margin-top: 4px;">{{form.serviceSpec[0]}}</text>

				</view>
			</view>
			<text>服务费用<text style="color: red;margin-left:4px;">￥{{form.payablePrice}}</text></text>
		</view>
		<view class="ddxx">
			<text class="dd">订单信息</text>
			<view class="itemdd">
				<text class="le"> 订单编号</text>
				<text class="ri">{{form.orderId}}</text>
			</view>
			<view class="itemdd">
				<text class="le">预约时间</text>
				<text class="ri">{{form.time[0]}}</text>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {

				}
			}
		},
		methods: {
			totel(e) {
				console.log(e);

				plus.device.dial(e, true);
				// uni.makePhoneCall({
				// 	phoneNumber: e, // 你要拨打的电话号码
				// 	success: function(res) {
				// 		console.log('电话拨打成功', res);
				// 		// 可以在这里做一些后续的操作，如更新界面状态等
				// 	},
				// 	fail: function(err) {
				// 		console.error('电话拨打失败', err);
				// 		// 处理失败时的逻辑，如展示提示信息
				// 	},
				// 	complete: function() {
				// 		console.log('拨打电话操作已完成');
				// 		// 完成后执行一些清理或最终的状态更新
				// 	}
				// });

			}
		},
		onLoad(e) {
			console.log("item", JSON.parse(e.item));
			this.form = {
				...JSON.parse(e.item)
			}
		}
	}
</script>

<style lang="scss">
	.detail {
		.status {
			border-radius: 2px;
			width: 100%;
			height: 50px;
			background: linear-gradient(to right, #f74346, #ec634c);
			padding-top: 15px;
			padding-left: 8px;

			.ywc {
				color: #ffffff;
			}
		}

		.kh {
			padding: 6px;

			.xx {
				font-size: 18px;
				font-weight: bold;
			}

			.khxx {
				text {
					margin-left: 4px;
				}

				image {
					width: 25px;
					height: 25px;
				}
			}

			.address {
				margin-top: 7px;

				image {
					width: 25px;
					height: 25px;
				}
			}
		}

		.ff {
			margin-top: 15px;
			padding: 8px;

			.ffxx {
				font-size: 18px;
				font-weight: bold;
			}

			.xx {
				display: flex;
				align-items: center;
				margin: 8px 0px;

				image {
					width: 55px;
					height: 45px;
				}

				.tt {
					margin-left: 8px;
					display: flex;
					flex-direction: column;

				}
			}


		}

		.ddxx {
			padding: 8px;
			margin-top: 15px;

			.dd {
				font-size: 18px;
				font-weight: bold;
			}

			.itemdd {
				margin-top: 2px;
				display: flex;
				justify-content: space-between;

				.le {
					color: #7c7876;
				}

				.ri {}
			}
		}



	}
</style>